import datetime
from distutils.log import error

from django.contrib.auth.decorators import login_required
from django.shortcuts import HttpResponse, redirect, render
from django.urls import reverse

from cdserver.utils.pagination import Pagenation

from .. import errors
from ..models import ReleaseInfo


@login_required
def release_list(request):
    """发版日志查询"""
    queryset = ReleaseInfo.objects.filter(status=4, deleted_at=None)
    page_object = Pagenation(request, queryset)
    context = {
        "object_list": page_object.page_queryset,
        "page_string": page_object.html(),
    }
    return render(request, "draft/release_list.html", context)
